package com.example.studentstatusmanagement.mapper;

import com.example.studentstatusmanagement.pojo.Classroom;
import com.example.studentstatusmanagement.pojo.ClassroomExample;

import java.util.List;

import com.example.studentstatusmanagement.pojo.doo.ReqClassroom;
import com.example.studentstatusmanagement.pojo.dto.ClassroomInfo;
import com.example.studentstatusmanagement.pojo.dto.SMajor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ClassroomMapper {
    int countByExample(ClassroomExample example);

    int deleteByExample(ClassroomExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Classroom record);

    int insertSelective(Classroom record);

    List<Classroom> selectByExample(ClassroomExample example);

    Classroom selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Classroom record, @Param("example") ClassroomExample example);

    int updateByExample(@Param("record") Classroom record, @Param("example") ClassroomExample example);

    int updateByPrimaryKeySelective(Classroom record);

    int updateByPrimaryKey(Classroom record);

    // 根据major id查询
    @Select("SELECT c.id,c.class_name as name FROM classroom c where c.major_id = #{id}")
    List<ClassroomInfo> selectClassroomsByMajorId(Integer id);

    List<SMajor> selectClassroosInfo(ReqClassroom reqClassroom);
}